package com.auxgroup.hr.front.site.vo.process;

import com.auxgroup.hr.front.commons.enums.WfTypeEnum;
import com.auxgroup.hr.front.ws.ProcessApproveQueDTO;
import org.apache.commons.lang.StringUtils;
import org.hibernate.validator.constraints.NotBlank;

import java.io.Serializable;
import java.util.List;

/**
 * Created by nitongqian on 2019/1/20.
 */
public class BaseApproveReq implements Serializable {

    @NotBlank(message="流程编号不能为空")
    private String cTransactionNbr;//流程编号
    @NotBlank(message="操作类型不能为空")
    private String actionType;//操作类型
    @NotBlank(message="流程类型不能为空")
    private String cWfType;//流程类型

    private String cComments;//审批意见
    private List<String> addUserIds;//加签人员
    private String cStepNbr; //驳回时的位置

    public ProcessApproveQueDTO init(String userOprId, String wfType){
        ProcessApproveQueDTO requestDTO = new ProcessApproveQueDTO();
        requestDTO.setC_ACTION_TYPE(getActionType());
        requestDTO.setC_COMMENTS(getcComments());
        requestDTO.setC_TRANSACTION_NBR(getcTransactionNbr());
        requestDTO.setAddUserids(getAddUserIds());
        requestDTO.setC_WF_TYPE(getcWfType());

        requestDTO.setC_STEP_NBR(getcStepNbr());

        requestDTO.setC_USERID(userOprId);
        if(StringUtils.isNotEmpty(wfType)) {
            requestDTO.setC_WF_TYPE(wfType);
        }

        return requestDTO;
    }

    public String getcWfType() {
        return cWfType;
    }

    public void setcWfType(String cWfType) {
        this.cWfType = cWfType;
    }

    public String getcStepNbr() {
        return cStepNbr;
    }

    public void setcStepNbr(String cStepNbr) {
        this.cStepNbr = cStepNbr;
    }

    public String getcTransactionNbr() {
        return cTransactionNbr;
    }

    public void setcTransactionNbr(String cTransactionNbr) {
        this.cTransactionNbr = cTransactionNbr;
    }

    public String getActionType() {
        return actionType;
    }

    public String getcComments() {
        return cComments;
    }

    public void setcComments(String cComments) {
        this.cComments = cComments;
    }

    public void setActionType(String actionType) {
        this.actionType = actionType;
    }


    public List<String> getAddUserIds() {
        return addUserIds;
    }

    public void setAddUserIds(List<String> addUserIds) {
        this.addUserIds = addUserIds;
    }
}
